import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/MyLogin.vue'
import Index from '@/views/MyIndex.vue'
import Home from '@/views/MyHome'
// 引入二级路由
import LikeDe from '@/views/Home/Index/LikeDe.vue'
import RunOrder from '@/views/Home/WorkOrderCtrl/RunOrder.vue'
import OperationOrder from '@/views/Home/WorkOrderCtrl/OperationOrder.vue'
import AreaCtrl from '@/views/Home/PlaceCtrl/AreaCtrl.vue'
import PlaceCtrl from '@/views/Home/PlaceCtrl/PlaceCtrl.vue'
import WithCtrl from '@/views/Home/PlaceCtrl/WithCtrl.vue'
import UnitCtrl from '@/views/Home/UnitCtrl/UnitCtrl.vue'
import UnitStatus from '@/views/Home/UnitCtrl/UnitStatus.vue'
import UnitClassCtrl from '@/views/Home/UnitCtrl/UnitClassCtrl.vue'
import PersonList from '@/views/Home/PersonCtrl/PersonList.vue'
import PersonStatistics from '@/views/Home/PersonCtrl/PersonStatistics.vue'
import WorkList from '@/views/Home/PersonCtrl/WorkList.vue'
import ShopsClass from '@/views/Home/ShopsCtrl/ShopsClass.vue'
import ShopsCtrl from '@/views/Home/ShopsCtrl/ShopsCtrl.vue'
import MethodCtrl from '@/views/Home/MethodCtrl/MethodCtrl.vue'
import OrderCtrl from '@/views/Home/OrderCtrl/OrderCtrl.vue'
import IsComputed from '@/views/Home/IsComputed/IsComputed.vue'
import four from '@/views/404.vue'
Vue.use(VueRouter)

const routes = [
  { path: '/four', component: four },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/index',
    component: Index
  }, {
    path: '/',
    component: Home,
    redirect: '/likede',
    children: [
      { path: '/likede', component: LikeDe },
      { path: '/runOrder', component: RunOrder },
      { path: '/operationOrder', component: OperationOrder },
      { path: '/areaCtrl', component: AreaCtrl },
      { path: '/placeCtrl', component: PlaceCtrl },
      { path: '/withCtrl', component: WithCtrl },
      { path: '/unitCtrl', component: UnitCtrl },
      { path: '/unitStatus', component: UnitStatus },
      { path: '/unitClassCtrl', component: UnitClassCtrl },
      { path: '/personList', component: PersonList },
      { path: '/personStatistics', component: PersonStatistics },
      { path: '/workList', component: WorkList },
      { path: '/shopsClass', component: ShopsClass },
      { path: '/shopsCtrl', component: ShopsCtrl },
      { path: '/methodCtrl', component: MethodCtrl },
      { path: '/orderCtrl', component: OrderCtrl },
      { path: '/isComputed', component: IsComputed }
    ]
  },
  { path: '/404', component: four },
  { path: '*', redirect: '/404' }
]
const router = new VueRouter({
  routes
})

export default router
